const express = require(`express`)
const router = express.Router()
var mongoose = require('mongoose');

mongoose.model('Teacher', new mongoose.Schema({
    教师所属系部: String,
    number: { type: String,           },
    name: { type: String, },
    tasks: [String],
    phone: { type: Date, },
    dep: { type: String },
    role:[String],
    mail: { type: String, },
    type: String,//教辅,教师
    password: { type: String },
    role: [String],
    job: [String]
  }))
  mongoose.model('Voter', new mongoose.Schema({
    number:String,
    role:String,
    vote:Boolean,
  }))
 
  
  mongoose.model('ShujiVoter', new mongoose.Schema({
    name:String,
    number:String,
    vote:Boolean,
  }))
  mongoose.model('Good', new mongoose.Schema({
    name:String,
    score:Number,
    cate:String,
    dep:String
  }))
 mongoose.model('Performance', new mongoose.Schema({
    project: { type: String },
    cate: { type: String },
    title: { type: String },
    createTime: { type: Date },//创建时间
    editTime: [{ date: Date, user: { type: mongoose.Schema.Types.ObjectId, ref: 'Teacher' } }],//编辑时间
    status: { type: String }, // 编辑,待批,驳回,通过,确认
    score: { type: Number },
    suggestion: String,
    LASTEDITDATE:String,
    RAWID:String,
    teachers: String,
    subject:String,
    参与教师: [{ number: String, 姓名: String, 分数: Number }],
    姓名: String,
    分数: { type: Number },
    单人或多人: String,
    讲课学时: Number,
    实验学时: Number,
    级别:String,
    到账经费:Number,
   
    dep: String, // 审批部门
    createTeacher: String,
    agreeTeacher: String
  },{ strict: false }
  ))
module.exports = router  